package com.car.dal.dao.client;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.car.bean.GridObj;
import com.car.bean.OrderObj;
import com.car.bean.PageObj;
import com.car.dal.dao.ibatis.IbatisCommonDao;
import com.car.dal.object.TgClient;
import com.car.util.Page;

public class TgClientDaoImpl extends IbatisCommonDao<TgClient, Long> implements TgClientDao {

    public GridObj GetList(TgClient client, PageObj pageObj) {
        OrderObj order = new OrderObj();
        order.setDir("desc");
        order.setSort("id");
        return super.findByPage(client, pageObj, order);
    }

    public Integer getClientCount(TgClient client) {
        return this.queryForInteger("getClientCount", client);
    }

    public Integer getClientQuery(TgClient client) {
        return this.queryForInteger("getClientQuery", client);
    }

    //查询老师
    public List<TgClient> getClientName(TgClient client) {
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientName", client);
        return list;
    }

    //查询城市
    public List<TgClient> getClientCityByType(TgClient client) {
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientCityByType", client);
        return list;
    }

    /**
     * 更新来源
     *
     * @param client
     * @param regionns
     * @return
     */
    @Override
    public Integer editSourceByKeyname(String client, String regionns) {
        Map<String, Object> args = new HashMap<String, Object>();
        args.put("client", client);
        args.put("regionns", regionns);
        return getSqlMapClientTemplate().update("updatetgClientSource", args);
    }

    //问卷查询老师
    public List<TgClient> getClientallot(TgClient client) {
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientallot", client);
        return list;
    }

    public List<TgClient> getTgClientByType(TgClient client, Page page) {
        client.setFirstrownum(page.getFirstrownum());
        client.setPagesize(page.getPagesize());
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientByType", client);
        return list;
    }

    public List<TgClient> getClientByTypeCdate(TgClient client, Page page) {
        client.setFirstrownum(page.getFirstrownum());
        client.setPagesize(page.getPagesize());
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientByTypeCdate", client);
        return list;
    }

    //客户资源下载
    public List<TgClient> clientlistXz(TgClient client) {
        List<TgClient> list = this.queryForEntityList(TgClient.class, "clientlistXz", client);
        return list;
    }

    public List<TgClient> getkeyword(TgClient client) {
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getkeyword", client);
        return list;
    }

    public Integer getClientCounts(TgClient client) {
        return this.queryForInteger("getClientCounts", client);
    }

    public Integer getClient_tempCount(TgClient client) {
        return this.queryForInteger("getClient_tempCount", client);
    }

    public List<TgClient> getClientByKeyname(TgClient client) {
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientByKeyname", client);
        return list;
    }

    public Integer getClientCountByType(TgClient client) {
        return this.queryForInteger("getClientCountByType", client);
    }

    public List<TgClient> getClientListByType(TgClient client, Page page) {
        client.setFirstrownum(page.getFirstrownum());
        client.setPagesize(page.getPagesize());
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientListByType", client);
        return list;
    }

    public List<TgClient> getClientByTypes(TgClient client) {
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientByTypes", client);
        return list;
    }

    public List<TgClient> getClientByPhone(TgClient client) {
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientByPhone", client);
        return list;
    }

    public Integer getClientSystem(TgClient client) {
        return this.queryForInteger("getClientSystem", client);
    }

    public List<TgClient> getClientBySystem(TgClient client, Page page) {
        client.setFirstrownum(page.getFirstrownum());
        client.setPagesize(page.getPagesize());
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientBySystem", client);
        return list;
    }

    //客户资源数量统计
    public Integer getClientCountByTime(TgClient client) {
        return this.queryForInteger("getClientCountByTime", client);
    }

    //周统计
    public Integer getZonClientCount(TgClient client) {
        return this.queryForInteger("getZonClientCount", client);
    }

    public Integer getWuxiaoClientCount(TgClient client) {
        return this.queryForInteger("getWuxiaoClientCount", client);
    }

    public Integer getBendiClientCount(TgClient client) {
        return this.queryForInteger("getBendiClientCount", client);
    }

    public Integer getWaidiClientCount(TgClient client) {
        return this.queryForInteger("getWaidiClientCount", client);
    }

    public Integer getZhuanchuClientCount(TgClient client) {
        return this.queryForInteger("getZhuanchuClientCount", client);
    }

    public Integer getClientsCountByType(TgClient client) {
        return this.queryForInteger("getClientsCountByType", client);
    }

	@Override
	public Integer getClientCountImpCBySource(TgClient client) {
		return this.queryForInteger("getClientCountImpCBySource", client);
	}

	@Override
	public List<TgClient> getClientListImpBySource(TgClient client, Page page) {
		client.setFirstrownum(page.getFirstrownum());
        client.setPagesize(page.getPagesize());
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientListImpBySource", client);
        return list;
	}

	@Override
	public List<TgClient> getStudentByName(TgClient client) {
		
		return this.queryForEntityList(TgClient.class, "getStudentByName", client);
	}

	@Override
	public Integer getClientCount3(TgClient client) {
		return this.queryForInteger("getClientCount3", client);
	}

	@Override
	public List<TgClient> getTgClientByType3(TgClient client, Page page) {
		client.setFirstrownum(page.getFirstrownum());
        client.setPagesize(page.getPagesize());
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientByType3", client);
        return list;
	}

	@Override
	public List<TgClient> getClientByTypeCdate3(TgClient client, Page page) {
		client.setFirstrownum(page.getFirstrownum());
        client.setPagesize(page.getPagesize());
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientByTypeCdate3", client);
        return list;
	}

	@Override
	public Integer getClientCount2(TgClient client) {
		return this.queryForInteger("getClientCount2", client);
	}

	@Override
	public List<TgClient> getClientByTypeCdate2(TgClient client, Page page) {
		client.setFirstrownum(page.getFirstrownum());
        client.setPagesize(page.getPagesize());
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientByTypeCdate2", client);
        return list;
	}

	@Override
	public List<TgClient> getTgClientByType2(TgClient client, Page page) {
		client.setFirstrownum(page.getFirstrownum());
        client.setPagesize(page.getPagesize());
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientByType2", client);
        return list;
	}

	@Override
	public Integer getClientCountMarket(TgClient client) {
		return this.queryForInteger("getClientCountMarket", client);
	}

	@Override
	public List<TgClient> getClientlistMarket(TgClient client, Page page) {
		client.setFirstrownum(page.getFirstrownum());
        client.setPagesize(page.getPagesize());
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientlistMarket", client);
        return list;
	}

	@Override
	public Integer getClientCount4(TgClient client) {
		return this.queryForInteger("getClientCount4", client);
	}

	@Override
	public List<TgClient> getClientByTypeCdate4(TgClient client, Page page) {
		client.setFirstrownum(page.getFirstrownum());
        client.setPagesize(page.getPagesize());
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientByTypeCdate4", client);
        return list;
	}

	@Override
	public List<TgClient> getTgClientByType4(TgClient client, Page page) {
		client.setFirstrownum(page.getFirstrownum());
        client.setPagesize(page.getPagesize());
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientByType4", client);
        return list;
	}

	@Override
	public Integer getClientCount5(TgClient client) {
		return this.queryForInteger("getClientCount5", client);
	}

	@Override
	public List<TgClient> getTgClientByType5(TgClient client, Page page) {
		client.setFirstrownum(page.getFirstrownum());
        client.setPagesize(page.getPagesize());
        List<TgClient> list = this.queryForEntityList(TgClient.class, "getClientByType5", client);
        return list;
	}
}
